import { caseIndex, dataBase, getValueById } from '@/utils/database'
export const columns = [
  {
    name: 'orderSn',
    label: '订单编号',
    search: true,
    width: 290,
    valueType: 'input',
    span: 8,
    attrs: {
      placeholder: '请输入订单编号',
    },
  },

  {
    name: 'orderType',
    label: '缴费项目',
    width: 100,
    formatter: (v) => {
      if (v.orderType) {
        return getValueById('jiaofeixiangmu', v.orderType)
      }
    },
  },
  {
    name: 'deviceId',
    label: '设备编号',
    width: 100,
    formatter: (v) => {
      return v?.properties?.deviceId
    },
  },
  {
    name: 'brand',
    label: '品牌',
    width: 100,
    formatter: (v) => {
      return caseIndex(v.brand || 'HD')
    },
  },
  {
    name: 'recConsignee',
    label: '用户名',
    width: 180,
  },
  {
    name: 'recMobile',
    label: '手机号',
    width: 200,
  },

  {
    name: 'priceActual',
    label: '缴费金额',
    width: 100,
  },
  {
    name: 'payTime',
    label: '缴费时间',
    sorter: true,
    search: true,
    width: 200,
    valueType: 'date-picker',
    span: 8,
    attrs: {
      placeholder: '请选择缴费时间',
      type: 'daterange',
      rangeSeparator: '至',
      startPlaceholder: '开始时间',
      endPlaceholder: '结束时间',
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD',
    },
  },
  {
    name: 'orderFrom',
    label: '缴费渠道',
    sorter: true,
    search: true,
    valueType: 'select',
    options: dataBase.jiaofeiqudao,
    span: 8,
    width: 100,
    formatter: (v) => {
      if (v.orderFrom) {
        return getValueById('jiaofeiqudao', v.orderFrom)
      }
    },
    attrs: {
      placeholder: '选择缴费渠道',
    },
  },

  {
    name: 'memo',

    showOverflowTooltip: true,
    label: '备注',
  },
]
